import { prop, modelOptions, mongoose } from '@typegoose/typegoose';
import { ApiProperty } from '@nestjs/swagger';
import { Base, TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';

// 给添加的数据加入时间戳
@modelOptions({
  schemaOptions: {
    timestamps: true,
  },
})
export class TabCollection extends TimeStamps implements Base {
  _id: mongoose.Types.ObjectId;
  id: string;

  @ApiProperty({ description: '相关的workspaceId' })
  @prop({
    required: true,
  })
  workspaceId: string;

  @ApiProperty({ description: '是否是用户定制的', default: false })
  @prop({
    default: false,
  })
  isCustomed: boolean;

  @ApiProperty({ description: 'tabCollection的名字', default: false })
  @prop({
    default: '默认tabCollection',
  })
  name: string;
}
